import React from 'react';
import { useThreeScene } from '@/hooks';

interface ThreeSceneProps {
  initFunction: (container: HTMLElement) => (() => void);
  style?: React.CSSProperties;
}

/**
 * 通用的Three.js场景组件
 * 可以接收任何Three.js初始化函数并渲染场景
 */
export const ThreeScene: React.FC<ThreeSceneProps> = ({ 
  initFunction, 
  style = { width: '100%', height: '100%' }
}) => {
  const mountRef = useThreeScene(initFunction);

  return <div ref={mountRef} style={style} />;
}; 